<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../build/react.js"></script>
    <script src="../build/react-dom.js"></script>
    <script src="../build/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
    var Counter = React.createClass({
        getInitialState: function () {
            return {
                clickCount: 0
            };
        },
        handleClick: function () {
            this.replaceState({clickCount: this.state.clickCount + 50},function () {
               window.console.log('加加加');
            })
        },
        render: function () {
            return (
                <h2 onClick={this.handleClick}>点我！点击次数为{this.state.clickCount}</h2>
            )
        }
    });
    ReactDOM.render(
        <Counter/>,
        document.getElementById('example')
    );
</script>
</body>
</html>